<form [formGroup]="formModel" (submit)="onSerch()" novalidate>
    <div class="form-group" [class.has-error]="formModel.hasError('minLength', 'title')">
        <label for = "productTitle">商品名称：</label>
        <input type="text" id="productTitle" placeholder="商品名称" class="form-control" formControlName="title">
        <span class="help-block" [class.hidden]="!formModel.hasError('minlength', 'title')">至少输入3个字段</span>
    </div>
    <div class="form-group" [class.has-error]="formModel.hasError('postiviteNum', 'price')">
        <label for = "productPrice">商品价格：</label>
        <input type="text" id="productPrice" placeholder="商品名称" class="form-control" formControlName="price">
        <span class="help-block" [class.hidden]="!formModel.hasError('postiviteNum', 'price')">至少输入正数</span>
    </div>
    <div class="form-group">
        <label for = "productCategory">商品类别：</label>
        <select id="productCategory" class="form-control" formControlName="category">
            <option value="-1">全部分类</option>
            <option *ngFor="let categor of categorys" [value]="categor">{{categor}}</option>
        </select>
    </div>
    <div class="form-group">
        <button type="submit" class="btn btn-primary btn-block">搜 索</button>
    </div>
</form>

